package edu.bbu.bibliospring.backend.repository;

import edu.bbu.bibliospring.backend.model.AbstractModel;
import edu.bbu.bibliospring.backend.repository.exception.BibliospringRepositoryException;

import javax.ejb.Local;
import java.util.List;

@Local
public interface BaseRepository<T extends AbstractModel, I> {

    List<T> getAll() throws BibliospringRepositoryException;

    T getById(I id) throws BibliospringRepositoryException;

    T save(T item) throws BibliospringRepositoryException;

    T merge(T item) throws BibliospringRepositoryException;

    I delete(T item) throws BibliospringRepositoryException;

}
